#include <iostream>
#include <memory>
#include "log.hpp"
#include "udp_server.hpp"

static void Usage(std::string proc)
{
    std::cout << "\nUsage Manual " << proc << " ServerPort" << std::endl;
}

// ./udp_server ip port
int main(int argc, char* argv[])
{
    if(argc != 3)
    {
        Usage(argv[0]);
        exit(1);
    }

    uint16_t port = atoi(argv[2]);
    std::unique_ptr<UdpServer> svr(new UdpServer(port));
    svr->initServer();
    svr->start();
    
    return 0;
}